import KoaRouter from 'koa-router';
const router = new KoaRouter({ prefix: '/sys/menu' });
import { auth, hadAdminPermission } from '../middleware/auth.middleware';
import { verifyPageSize } from '../middleware/pagesize.middleware';
import { menuValidator, verifyMenu } from '../middleware/menu.middleware';
import MenuController from '../controller/menu.controller';

router.use(auth);
router.use(hadAdminPermission);
//创建新增
router.post('/create', menuValidator,verifyMenu,MenuController.create)
//删除
router.delete('/delete',MenuController.delete)
//修改
router.put('/update',MenuController.update)
//查询
router.get('/queryList', verifyPageSize,MenuController.queryList)

export default router;